package Finance

object YahooQuote {


	def main(args: Array[String]): Unit = {

			val yqc:YahooQuoteCaller  = new YahooQuoteCaller

			val yqc2:YahooQuoteCaller  = new YahooQuoteCaller
			val listStr = List("IBM","Apple")
			val listStr2 = List("IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple","IBM","Apple",
					"Microsoft","Apple","IBM"
			)

			val ret2 = yqc.getQuote(listStr2)
			println(ret2.length)
			printListOfArray(ret2)

			/*
			val rett2 = yqc2.getQuote(listStr)
			println(rett2.length)
			printListOfArray(rett2)


			yqc.useExtendedQueryFormat


			val ret22 = yqc.getQuote(listStr)
			println(ret22.length)
			printListOfArray(ret22)

			val rett22 = yqc2.getQuote(listStr)
			println(rett22.length)
			printListOfArray(rett22)


			 val ret= yqc.getOneQuote("IBM")

			//println(ret.length)
			//printListOfArray(ret)

			val ret4= yqc.getOneQuote("IBM")
			println(ret4.length)
			printListOfArray(ret4)


			val ret7= yqc.getOneQuote("IBM")
			println(ret7.length)
			printListOfArray(ret7)


			yqc.useExtendedQueryFormat
			val ret8= yqc.getOneQuote("IBM")
			println(ret8.length)
			printListOfArray(ret8)



			val ret5= yqc.getOneQuote("apple")
			println(ret5.length)
			printListOfArray(ret5)

			yqc.useRealtimeQueryFormat
			val ret6= yqc.getOneQuote("apple")
			println(ret6.length)
			printListOfArray(ret6)
			printListOfArray(ret5)
			printListOfArray(ret2)


			yqc.setQueryString("snl")
			val ret11= yqc.getOneQuote("apple")
			println(ret11.length)
			printListOfArray(ret11)



			val ret12 = yqc.getCustomQuote(List("DELL","IBM"), List("Name","Book Value"))
			println(ret12.length)
			printListOfArray(ret12)
			 */

	}


	def printListOfArray(varListOfArray:List[Array[String]]){
		var cnt:Int=0;
	varListOfArray.foreach(arr => {
		cnt+=1;
		arr.foreach(elem => {

			print(cnt+" "+elem+" ")})
			//println(arr.length)
			//println()
	})
	}



}